package com.example.order.dao;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.netflix.ribbon.proxy.annotation.Hystrix;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@FeignClient(name = "client",fallback = Toclient.FallbackClient.class)
public interface Toclient {

//    @HystrixCommand(commandProperties = {
//            @HystrixProperty(name="circuitBreaker",value = )
//
//    })
    @GetMapping("/bobo/didi")
    String getclient();

    @Component
    static class FallbackClient implements Toclient{
        @Override
        public  String getclient() {
            return "太拥挤了啦，卡爆了www";
        }
    }

}
